package com.ex.touristtravels;


import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

public class StartActivity extends Activity {

	private Context mcontent;
	private TextView tv_title; // 标题
	private ImageView im_left; // 左边图标
	private ImageView im_right; // 右边图标
	private  String title1="这是欢迎界面";   //测试标题
	private int id_left = R.drawable.nav_btn_list_mark;   //测试左边图标
	private int id_right = R.drawable.selector_title_left;  //测试右边图标
	private String left_text_show = "你点击了我这个左边的图标";
	private String right_text_show = "你点击了我这个右边边的图标";
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_start);
		onCreateView();
	}

	
	private void onCreateView() {
		tv_title = (TextView)findViewById(R.id.xtitle_title);
		im_left = (ImageView)findViewById(R.id.xtitle_left);
		im_right = (ImageView)findViewById(R.id.xtitle_right);
		im_left.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Toast.makeText(StartActivity.this, left_text_show, Toast.LENGTH_SHORT).show();
			}
		});
		
		im_right.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Toast.makeText(StartActivity.this,right_text_show , Toast.LENGTH_SHORT).show();
			}
		});
		initUI();
		
	}
	
	
	public void initUI() {   
//		public void initUI(String title, int id_left, int id_right) {   
		tv_title.setText(title1);
		im_left.setImageResource(id_left);
		im_right.setImageResource(id_right);
		
	}


	
	
}
